﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using IRC.IRepairClouds.DataLayer;

namespace IRC.IRepairClouds.WebClient.DataObjects
{
    public class Grid
    {
        public int PageIndex { get; set; }
        public int PageSize { get; set; }
        public SortField Sort { get; set; }

        public int StartIndex
        {
            get { return PageIndex * PageSize; }
        }

        public void CheckActualCount(int count)
        {
            if (StartIndex > count)
            {
                PageIndex = count / PageSize;
            }
        }
    }
}